package dtaskboard.client.service;

import java.util.Collection;

import com.google.gwt.user.client.rpc.AsyncCallback;

import dtaskboard.client.dto.LoginDTO;
import dtaskboard.client.dto.RoleClass;
import dtaskboard.client.dto.RoleDTO;

public interface LoginServiceAsync {
  void login(String user, String password, AsyncCallback<String> callback)
      throws IllegalArgumentException;

  void logout(String sessionId, AsyncCallback<Void> callback)
      throws IllegalArgumentException;

  void isAuthenticated(String sessionId, AsyncCallback<Boolean> callback)
      throws IllegalArgumentException;

  void getUserRoles(String sessionId,
      AsyncCallback<Collection<RoleDTO>> callback)
      throws IllegalArgumentException;

  void getLoginDTO(String sessionId, AsyncCallback<LoginDTO> callback);

  void saveUser(String username, String password, String name,
      String sessionId, AsyncCallback<Void> callback);

  void addRoleToUser(String username, RoleClass role, String projectName,
      String sessionId, AsyncCallback<Void> callback);

  void changePassword(String oldPass, String newPass, String sessionId,
      AsyncCallback<Void> callback);
}
